package com.ruoyi.game.constant;

/**
 * 游戏 WebSocket 通用错误码
 * 通用错误段：0 - 99
 * 游戏业务错误段：1000 - 1999
 */public class GameErrorCode {

    /* 通用错误 (0-99) */
    public static final int SUCCESS = 0;
    public static final int UNKNOWN_ERROR = 1;
    public static final int INVALID_REQUEST = 2;
    public static final int UNAUTHORIZED = 3;
    public static final int SESSION_NOT_FOUND = 4;
    public static final int SEND_PACKET_ERROR = 5;
    public static final int BROADCAST_FAILED = 6;


    /* 房间相关错误 (100-199) */
    public static final int ROOM_NOT_FOUND = 100;
    public static final int ROOM_SEAT_NOT_FOUND = 101;
    public static final int ROOM_FULL = 102;
    public static final int ROOM_JOIN_FAILED = 103;

    /* 游戏相关错误 (200-299) */
    public static final int GAME_NOT_FOUND = 200;
    public static final int GAME_ALREADY_STARTED = 201;
    public static final int INVALID_GAME_OPERATION = 202;
    public static final int SET_ID_NOT_MATCH = 203;
    public static final int LIANGZHU_ERROR = 204;
    public static final int NO_PLAYER_TO_DEAL = 205;
    public static final int DEAL_ERROR = 206;
    public static final int DEALER_NOT_FOUND = 207;
    public static final int KOUDI_FAILED = 208;
    public static final int HANDA_FAILED = 209;
    public static final int FANDI_ERROR = 210;
    public static final int CALC_SHENGJI_ERROR = 211;
    public static final int CALC_SCORE_ERROR = 212;
    public static final int PUSH_SETTLE_ERROR = 213;
    public static final int SAVE_GAMESET_ERROR = 214;
    public static final int SETTLE_PLAYER_ERROR = 215;
    public static final int INVALID_ROUND_ID = 216;
    public static final int OP_TIMEOUT = 217;
    public static final int INVALID_OP = 218;
    public static final int PLAYER_ALREADY_IN_OTHER = 219;


    /* 玩家相关错误 (300-399) */
    public static final int PLAYER_NOT_FOUND = 300;
    public static final int PLAYER_ALREADY_IN_ROOM = 301;
    public static final int PLAYER_NOT_IN_ROOM = 302;
    public static final int PLAYER_OFFLINE = 303;
    public static final int ROOM_PLAYER_NOT_ENOUGH = 304;   // 房间人数不足
    public static final int OPERATION_FAILED = 305;
    public static final int INVALID_OPTYPE = 306;
    public static final int LEAVE_ROOM_FAILED = 307;
    public static final int DISSOLVE_ROOM_FAILED = 308;


    /* 房卡相关错误 (400-499) */
    public static final int ROOM_CARD_NOT_ENOUGH = 400;

    /* 牌型相关错误 (500-599) */
    public static final int INVALID_CARD = 500;
    public static final int ALREADY_LIANGZHU = 501;
    /* 其他预留 */
}

